﻿using QFramework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using YooAsset;


public class CmdStartYooassetDown : AbstractCommand
{
    EPlayMode playMode;
    string defaultHostServer;
    string fallbackHostServer;
    public CmdStartYooassetDown(EPlayMode playMode,string defaultHostServer,string fallbackHostServer) 
    {
        this.playMode = playMode;
        this.defaultHostServer = defaultHostServer;
        this.fallbackHostServer = fallbackHostServer;
    }
    protected override void OnExecute()
    {
        this.GetModel<QFYooassetModule>().PlayMode = playMode;
        this.GetModel<QFYooassetModule>().defaultHostServer = defaultHostServer;
        this.GetModel<QFYooassetModule>().fallbackHostServer = fallbackHostServer;
        this.GetModel<QFYooassetModule>().GotoDownload();
    }

}

public class CmdYooRelease : AbstractCommand
{
    protected override void OnExecute()
    {
        this.GetModel<QFYooassetModule>().Release();
    }
}

public class QueryHyclrLoadAotdlls : AbstractQuery<Task<bool>>
{
    protected override async Task<bool> OnDo()
    {
        return await this.GetModel<QFHyclrModule>().LoadMetadataForAOTAssemblies();
    }


}